using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ImageAnalystTools._ClassificationandPatternRecognition
{
    /// <summary>
    /// <para>Create Accuracy Assessment Points</para>
    /// <para>Creates randomly sampled points for post-classification accuracy assessment.</para>
    /// <para>创建随机抽样点，用于分类后准确性评估。</para>
    /// </summary>    
    [DisplayName("Create Accuracy Assessment Points")]
    public class CreateAccuracyAssessmentPoints : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public CreateAccuracyAssessmentPoints()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_class_data">
        /// <para>Input Raster or Feature Class Data</para>
        /// <para><xdoc>
        ///   <para>The input classification image or other thematic GIS reference data. The input can be a raster or feature class.</para>
        ///   <para>Typical data is a classification image of a single band, integer data type.</para>
        ///   <para>If using polygons as input, only use those that are not used as training samples. They can also be GIS land-cover data in shapefile or feature class format.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入分类图像或其他专题 GIS 参考数据。输入可以是栅格或要素类。</para>
        ///   <para>典型数据是单个波段、整数数据类型的分类图像。</para>
        ///   <para>如果使用多边形作为输入，请仅使用未用作训练样本的多边形。它们也可以是 shapefile 或要素类格式的 GIS 土地覆被数据。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_points">
        /// <para>Output Accuracy Assessment Points</para>
        /// <para>The output point shapefile or feature class that contains the random points to be used for accuracy assessment.</para>
        /// <para>输出点 shapefile 或要素类，其中包含用于精度评估的随机点。</para>
        /// </param>
        public CreateAccuracyAssessmentPoints(object _in_class_data, object _out_points)
        {
            this._in_class_data = _in_class_data;
            this._out_points = _out_points;
        }
        public override string ToolboxName => "Image Analyst Tools";

        public override string ToolName => "Create Accuracy Assessment Points";

        public override string CallName => "ia.CreateAccuracyAssessmentPoints";

        public override List<string> AcceptEnvironments => ["extent", "geographicTransformations", "outputCoordinateSystem"];

        public override object[] ParameterInfo => [_in_class_data, _out_points, _target_field.GetGPValue(), _num_random_points, _sampling.GetGPValue()];

        /// <summary>
        /// <para>Input Raster or Feature Class Data</para>
        /// <para><xdoc>
        ///   <para>The input classification image or other thematic GIS reference data. The input can be a raster or feature class.</para>
        ///   <para>Typical data is a classification image of a single band, integer data type.</para>
        ///   <para>If using polygons as input, only use those that are not used as training samples. They can also be GIS land-cover data in shapefile or feature class format.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入分类图像或其他专题 GIS 参考数据。输入可以是栅格或要素类。</para>
        ///   <para>典型数据是单个波段、整数数据类型的分类图像。</para>
        ///   <para>如果使用多边形作为输入，请仅使用未用作训练样本的多边形。它们也可以是 shapefile 或要素类格式的 GIS 土地覆被数据。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Raster or Feature Class Data")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_class_data { get; set; }


        /// <summary>
        /// <para>Output Accuracy Assessment Points</para>
        /// <para>The output point shapefile or feature class that contains the random points to be used for accuracy assessment.</para>
        /// <para>输出点 shapefile 或要素类，其中包含用于精度评估的随机点。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Accuracy Assessment Points")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_points { get; set; }


        /// <summary>
        /// <para>Target Field</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the input data is a classified image or ground truth data.</para>
        ///   <bulletList>
        ///     <bullet_item>Classified—The input is a classified image. This is the default.</bullet_item><para/>
        ///     <bullet_item>Ground truth—The input is reference data.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定输入数据是分类图像还是地面实况数据。</para>
        ///   <bulletList>
        ///     <bullet_item>分类 - 输入为分类影像。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>真实值 - 输入为参考数据。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Target Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _target_field_value _target_field { get; set; } = _target_field_value._CLASSIFIED;

        public enum _target_field_value
        {
            /// <summary>
            /// <para>Classified</para>
            /// <para>Classified—The input is a classified image. This is the default.</para>
            /// <para>分类 - 输入为分类影像。这是默认设置。</para>
            /// </summary>
            [Description("Classified")]
            [GPEnumValue("CLASSIFIED")]
            _CLASSIFIED,

            /// <summary>
            /// <para>Ground truth</para>
            /// <para>Ground truth—The input is reference data.</para>
            /// <para>真实值 - 输入为参考数据。</para>
            /// </summary>
            [Description("Ground truth")]
            [GPEnumValue("GROUND_TRUTH")]
            _GROUND_TRUTH,

        }

        /// <summary>
        /// <para>Number of Random Points</para>
        /// <para><xdoc>
        ///   <para>The total number of random points that will be generated.</para>
        ///   <para>The actual number may exceed but never fall below this number, depending on sampling strategy and number of classes. The default number of randomly generated points is 500.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将生成的随机点总数。</para>
        ///   <para>实际数量可能超过但永远不会低于这个数字，具体取决于抽样策略和类数。随机生成的默认点数为 500。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number of Random Points")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _num_random_points { get; set; } = 500;


        /// <summary>
        /// <para>Sampling Strategy</para>
        /// <para><xdoc>
        ///   <para>Specify a sampling scheme to use.</para>
        ///   <bulletList>
        ///     <bullet_item>Stratified random—Create points that are randomly distributed within each class, where each class has a number of points proportional to its relative area. This is the default</bullet_item><para/>
        ///     <bullet_item>Equalized stratified random—Create points that are randomly distributed within each class, where each class has the same number of points.</bullet_item><para/>
        ///     <bullet_item>Random—Create points that are randomly distributed throughout the image.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定要使用的采样方案。</para>
        ///   <bulletList>
        ///     <bullet_item>分层随机 - 创建在每个类中随机分布的点，其中每个类都具有与其相对面积成比例的点数。这是默认设置</bullet_item><para/>
        ///     <bullet_item>均衡分层随机 - 创建在每个类中随机分布的点，其中每个类具有相同数量的点。</bullet_item><para/>
        ///     <bullet_item>随机 （Random） - 创建随机分布在整个图像中的点。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Sampling Strategy")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _sampling_value _sampling { get; set; } = _sampling_value._STRATIFIED_RANDOM;

        public enum _sampling_value
        {
            /// <summary>
            /// <para>Stratified random</para>
            /// <para>Stratified random—Create points that are randomly distributed within each class, where each class has a number of points proportional to its relative area. This is the default</para>
            /// <para>分层随机 - 创建在每个类中随机分布的点，其中每个类都具有与其相对面积成比例的点数。这是默认设置</para>
            /// </summary>
            [Description("Stratified random")]
            [GPEnumValue("STRATIFIED_RANDOM")]
            _STRATIFIED_RANDOM,

            /// <summary>
            /// <para>Equalized stratified random</para>
            /// <para>Equalized stratified random—Create points that are randomly distributed within each class, where each class has the same number of points.</para>
            /// <para>均衡分层随机 - 创建在每个类中随机分布的点，其中每个类具有相同数量的点。</para>
            /// </summary>
            [Description("Equalized stratified random")]
            [GPEnumValue("EQUALIZED_STRATIFIED_RANDOM")]
            _EQUALIZED_STRATIFIED_RANDOM,

            /// <summary>
            /// <para>Random</para>
            /// <para>Random—Create points that are randomly distributed throughout the image.</para>
            /// <para>随机 （Random） - 创建随机分布在整个图像中的点。</para>
            /// </summary>
            [Description("Random")]
            [GPEnumValue("RANDOM")]
            _RANDOM,

        }

        public CreateAccuracyAssessmentPoints SetEnv(object extent = null, object geographicTransformations = null, object outputCoordinateSystem = null)
        {
            base.SetEnv(extent: extent, geographicTransformations: geographicTransformations, outputCoordinateSystem: outputCoordinateSystem);
            return this;
        }

    }

}